#include <cmath>
#include <vector>

using namespace std;

class Solution {
private:
    vector<double> gen_center(vector<int>& p1, vector<int>& p2, int& r) {
        double dis = sqrt(pow(p1[0] - p2[0], 2) + pow(p1[1] - p2[1], 2));
        if (dis > 2 * r) {
            return {};
        }
        double mid_x = (p1[0] + p2[0]) / 2.0;
        double mid_y = (p1[1] + p2[1]) / 2.0;
        double b = sqrt(r * r - pow(dis / 2, 2));
        double angle = atan2(p1[0] - p2[0], p2[1] - p1[1]);
        return {mid_x + cos(angle) * b, mid_y + sin(angle) * b};
    }
public:
    int numPoints(vector<vector<int>>& points, int r) {
        int ans = 1;
        for (vector<int>& p1 : points) {
            for (vector<int>& p2 : points) {
                vector<double> center = gen_center(p1, p2, r);
                if (center.empty()) {
                    continue;
                }
                int num = 0;
                for (vector<int>& p3 : points) {
                    double dis = sqrt(pow(center[0] - p3[0], 2) + pow(center[1] - p3[1], 2));
                    if (dis <= r) {
                        num++;
                    }
                }
                ans = max(num, ans);
            }
        }
        return ans;
    }
};

int main() {
    vector<vector<int>> input = {{-2, 0}, {2, 0}, {0, 2}, {0, -2}};
    Solution solution;
    solution.numPoints(input, 2);
}